package okw.database;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

public class Vote extends core.modules.database.SuperVote implements Serializable {

	private static final long serialVersionUID = -510377279315111669L;

	private VotesPackage votesPackage;
	private Set<VotingSubcardOption> votingSubcardOptions = new HashSet<VotingSubcardOption>();

	public Vote() {
		super();
	}

	public Vote(Timestamp createdTime) {
		super(createdTime);
	}

	public VotesPackage getVotesPackage() {
		return votesPackage;
	}

	public void setVotesPackage(VotesPackage votesPackage) {
		this.votesPackage = votesPackage;
	}

	public Set<VotingSubcardOption> getVotingSubcardOptions() {
		return votingSubcardOptions;
	}

	public void setVotingSubcardOptions(Set<VotingSubcardOption> votingSubcardOptions) {
		this.votingSubcardOptions = votingSubcardOptions;
	}

	public void addToVotingSubcardOption(VotingSubcardOption votingSubcardOptions) {
		this.getVotingSubcardOptions().add(votingSubcardOptions);
		votingSubcardOptions.getVotes().add(this);
	}

	public void removeFromVotingSubcardOption(VotingSubcardOption votingSubcardOptions) {
		this.getVotingSubcardOptions().remove(votingSubcardOptions);
		votingSubcardOptions.getVotes().remove(this);
	}
}
